﻿@using QDT.Core
@using QDT.Core.Deals
@using QDT.MVC.UI
@using QDT.Web
@model QDT.Common.IPagedList<Credit>
@{
    ViewBag.Title = "投资记录";
}
<script src="/Content/Default/JS/change.js" type="text/javascript"></script>
<script type="text/javascript">
    $().ready(function () {
        $("#ui-toubiaozhong a").addClass("a_class");
        $("#InvestmentProjects").css("background", "#e0524b");
        $("#InvestmentProjects i,#InvestmentProjects span").css("color", "white");
        $("#InvestmentProjects .san-jiaoxing").css("display", "block");
    });
</script>
<link href="../../Content/Default/CSS/Investing.css" rel="stylesheet" type="text/css" />
@Html.Action("_UserBanner")
<div class="ui-bodyIn">
    <div class="ui-inner">
        <div class="ui-grid-row">
            @Html.Action("UserMenu", new { route = MenuRoute.InvestmentProjects })
            <div class="ui-grid-20" style="width: 758px;" id="right_box">
                <div class="ui-box">
                    @Html.Partial("_Investmentproject")
                    <div class="ui-table-container">
                        <table style="width: 100%">
                            <!-- 可以在class中加入ui-table-inbox或ui-table-noborder分别适应不同的情况 -->
                            <thead>
                                <tr>
                                    <th style="padding-left: 50px;">
                                        项目信息
                                    </th>
                                    <th class="th_center">
                                        债权
                                    </th>
                                    <th class="th_center">
                                        已回款
                                    </th>
                                    <th class="th_center">
                                        待回款
                                    </th>
                                    <th>
                                        &nbsp;
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="datalist">
                                  @foreach (var m in Model)
                                {
                                    var project = Html.F().GetProject(m.ProjectID);
                                    <tr>
                                    <td class="td_first">
                                        <span><a style="text-decoration: underline;font-size: 14px;" href="@Url.Action("Index", "Project", new { id = project.ID })">@project.Name</a></span>
                                        @if (m.AssignmentID != 0)
                                        {
                                              <div class="ready_buy">已买债权</div>
                                        }
                                      
                                        <div style="line-height: 20px; color: #9d9d9d;">
                                            <span>预期年化收益率：</span><span>@project.Rate<span>%</span></span>&nbsp;&nbsp;<span>期限：</span><span>@project.RepayTime</span><span>个月</span><br />
                                            <span>投标时间：</span><span>@m.CreateTime</span></div>
                                    </td>
                                    <td class="td_234">
                                         <span style="@(m.Money > 0 ? "color:#27ae60" : "color: #f39c12")">@m.BuyMoney.ToMoney()@(m.Money > 0 ? "" : "(转)")</span><br/>
                                        @if (m.AssignmentID != 0)
                                        {
                                            var creditExtension = Html.F().GetCreditExtension(m.ID);
                                            if (creditExtension != null)
                                            {
                                                <span>
                                                    @("息:" + creditExtension.PayEarning.ToMoney())
                                                    /
                                                    @("折:" + (creditExtension.Discount * -1).ToMoney())
                                                </span>
                                            }
                                        }
                                    </td>
                                    <td class="td_234">
                                          <span style="@(m.RepayMoney > 0 ? "color:#27ae60" : "color: #f39c12")">0</span>
                                    </td>
                                    <td class="td_234">
                                        @m.WaitRepayMoney.ToMoney()
                                    </td>
                                   
                                    <td style="width: 90px; text-align: center; font-size: 15px;">
                                         @if (m.AssignmentID == 0)
                                                {
                                                    <a  class="check_ht" href="javascript:;" onclick=" javascript:window.open('/Project/Agreement/@m.ProjectID', '', 'width=1024px;height=768px,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=20,left=20,resizable=no'); ">查看合同<i class="iconfont">&#xf02af;</i></a>
                                                }
                                                else
                                                {
                                                    <a  class="check_ht" href="javascript:;" onclick=" javascript:window.open('/Assignment/Agreement/@m.ID', '', 'width=1024px;height=768px,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=20,left=20,resizable=no'); ">查看合同<i class="iconfont">&#xf02af;</i></a>
                                                }
                                    </td>
                                </tr>
                                }
                            </tbody>
                        </table>
                    </div>
                    @Html.ClientPager(Model)
                </div>
            </div>
        </div>
    </div>
</div>
<div style="margin-top: -10px;">@Html.Partial("_BindBottomImage")</div>
